luci-app-firewall: Add ipset field to forwards (redirects)
authorPaul Dee <[email protected]>
Fri, 17 Feb 2023 12:56:40 +0000 (13:56 +0100)
committerJo-Philipp Wich <[email protected]>
Mon, 3 Apr 2023 11:51:44 +0000 (13:51 +0200)
Signed-off-by: Paul Dee <[email protected]>
(cherry picked from commit d0d891c23eb65da42ae6c1b8f0156e971abea5b3)

applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js

index 149e4f0f332abe8406b1cdee1dda6b6eaf9354d4..66f50f799eb03f20bd3a6531d18dc0cc4ee5400d 100644 (file)
@@ -240,6 +240,14 @@ return view.extend({
                o.nocreate = true;
                o.default = 'wan';
 
+               o = s.taboption('advanced', form.Value, 'ipset', _('Use ipset'));
+               uci.sections('firewall', 'ipset', function(s) {
+                       if (typeof(s.name) == 'string')
+                               this.value(s.name, s.comment ? '%s (%s)'.format(s.name, s.comment) : s.name);
+               });
+               o.modalonly = true;
+               o.rmempty = true;
+
                o = fwtool.addMACOption(s, 'advanced', 'src_mac', _('Source MAC address'),
                        _('Only match incoming traffic from these MACs.'), hosts);
                o.rmempty = true;